# 假设你在同一个文件里调用，或者导入 curl_to_requests
from curl_converter import curl_to_requests # 如果是单独的文件

# 你的 curl 命令，请确保它是完整的单行字符串
# 使用三引号来处理多行文本和包含引号的字符串
curl_command = """
curl --location --request POST 'http://211.84.64.251/eportal/InterFace.do?method=login' \\
--header 'Cookie: EPORTAL_COOKIE_USERNAME=2247102148; EPORTAL_COOKIE_SERVER=; EPORTAL_COOKIE_DOMAIN=; EPORTAL_COOKIE_SAVEPASSWORD=true; EPORTAL_COOKIE_OPERATORPWD=; EPORTAL_COOKIE_NEWV=true; EPORTAL_COOKIE_PASSWORD=0bef6b57cfd691bea20a46d9f3e9e961fe48636e58022bdb63574b840014876865d81584161883badf39db3fd41f80183ec879603d0225fbe34b448e4a951b3015ab1a2d683b66b15106b34d192bb28821397f24fdad7ab0ef9be1c294077e0549cf77813402581058a41d592e19e39d7a67b72ba0906eee099adb77d858f093; EPORTAL_AUTO_LAND=; EPORTAL_USER_GROUP=INC%E5%AD%A6%E7%94%9F; EPORTAL_COOKIE_SERVER_NAME=; JSESSIONID=E1A3E1EB9B96E1EC5C8ACAD4BA1251A3; JSESSIONID=A2814936C9E70A43708FD72793B6F4B6' \\
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \\
--header 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \\
--header 'Accept: */*' \\
--header 'Host: 211.84.64.251' \\
--header 'Connection: keep-alive' \\
--data-urlencode 'userId=2247102148' \\
--data-urlencode 'password=0bef6b57cfd691bea20a46d9f3e9e961fe48636e58022bdb63574b840014876865d81584161883badf39db3fd41f80183ec879603d0225fbe34b448e4a951b3015ab1a2d683b66b15106b34d192bb28821397f24fdad7ab0ef9be1c294077e0549cf77813402581058a41d592e19e39d7a67b72ba0906eee099adb77d858f093' \\
--data-urlencode 'service=' \\
--data-urlencode 'queryString=wlanuserip%3D10.101.80.229%26wlanacname%3DSQSY_S18010%26ssid%3D%26nasip%3D211.84.64.1%26snmpagentip%3D%26mac%3D00919e465307%26t%3Dwireless-v2-plain%26url%3Dhttp%3A%2F%2F123.123.123.123%2F%26apmac%3D%26nasid%3DSQSY_S18010%26vid%3D562%26port%3D222%26nasportid%3DAggregatePort%252034.05620000%3A562-0' \\
--data-urlencode 'operatorPwd=' \\
--data-urlencode 'operatorUserId=' \\
--data-urlencode 'validcode=' \\
--data-urlencode 'passwordEncrypt=true'
"""

# 调用函数进行转换
python_code = curl_to_requests(curl_command)

# 打印生成的 Python 代码
print(python_code)